package com.shuwang.geguo.webviewforsvg;

import android.content.Context;
import android.webkit.JavascriptInterface;
import android.widget.Toast;

/**
 * Created by Administrator on 2016/3/21.
 */
public class JavaScriptinterface {
    Context context;
    public JavaScriptinterface(Context context) {
    this.context=context;
    }

//   在Android4.2以后需要注册;
//   为了安全只有注册后的方法才能被调用
    @JavascriptInterface
    public void showToast(String id){
        Toast.makeText(context,"点击了"+id,Toast.LENGTH_SHORT).show();

    }
}
